2009-01-26 Sven Neumann <sven@gimp.org>
* babl/babl.h
* babl/babl-format.c: renamed
babl_format_get_num_of_components()
to babl_format_get_n_components().
(babl_format_has_alpha): changed accordingly.
svn path=/trunk/; revision=391
+2009-01-26 Sven Neumann <sven@gimp.org>
+
+ * babl/babl.h
+ * babl/babl-format.c: renamed babl_format_get_num_of_components()
+ to babl_format_get_n_components().
+ (babl_format_has_alpha): changed accordingly.
+
2009-01-24 Martin Nordholts <martinn@svn.gnome.org>
Do a complete overhaul of the babl API.
int
babl_format_has_alpha (const Babl *format)
{
+ int n = babl_format_get_n_components (format);
int i;
- int has_alpha = 0;
- for (i = 0; i < babl_format_get_num_of_components (format); i++)
+ for (i = 0; i < n; i++)
{
if (format->format.component[i]->alpha)
{
- has_alpha = 1;
- break;
+ return 1;
}
}
- return has_alpha;
+ return 0;
}
int
}
int
-babl_format_get_num_of_components (const Babl *format)
+babl_format_get_n_components (const Babl *format)
{
if (format->class_type == BABL_FORMAT)
{
/**
* Returns the number of components for the given @format.
*/
-int babl_format_get_num_of_components (const Babl *format);
+int babl_format_get_n_components (const Babl *format);
/**
* Returns the type in the given @format for the given